package com.brave.commonly.help;

import android.graphics.Bitmap;
import android.os.Bundle;
import android.util.Log;

import androidx.appcompat.app.AppCompatActivity;

import com.brave.commonly.utils.AppUtils;
import com.brave.commonly.utils.ImageUtils;
import com.brave.commonly.utils.PathUtils;
import com.brave.commonly.utils.ScreenshotUtils;

import java.io.File;

/**
 * MainActivity
 * <br/>
 * {@link @author} brave tao
 * <br/>
 * {@link @time} 2019/7/23
 * <br/>
 * {@link @description} 主页
 */
public class MainActivity extends AppCompatActivity {
    private static final String TAG = "MainActivity";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        File file = new File(PathUtils.getExternalStoragePath(), "enjoy");
        ImageUtils.save(ScreenshotUtils.getViewScreenshot(getCurrentFocus()),
                new File(file, "sj.png"),
                Bitmap.CompressFormat.PNG);

        Log.d(TAG, "onCreate: " + AppUtils.getVersionName());
        Log.d(TAG, "onCreate: " + AppUtils.getVersionCode());
    }
}